<!DOCTYPE html>
<html lang="en">
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="/public/static/h-ui.admin/css/style.css?v=1.3" />
    <link media="all" href="/public/menu/css/article.css" type="text/css" rel="stylesheet">
</head>
<body style="background-color: rgb(255, 255, 255);">
<div class="jbox-container" style="float: left; padding: 0px;position: relative;">
    <ul class="gagp-goodslist" style="padding: 10px; width: 750px;">
        <table class="wxtables">
            <colgroup>
                <col width="10%"><col width="15%"><col width="20%"><col width="25%"><col width="15%">
            </colgroup>
            <thead>
            <tr style="background-color: rgb(13, 163, 249);">
                <td>ID</td>
                <td>商品图片</td>
                <td>商品名称</td>
                <td>发布时间</td>
                <td>价格</td>
                <td>操作</td>
            </tr>
            </thead>
            <tbody>
            {volist name="goods" id="vo"}
                <tr>
                    <td><p>{$vo['goods_id']}</p></td>
                    <td><p><img src="{$vo['img_cover']}" alt="" height="50px" width="50px"></p></td>
                    <td><p>{$vo['goods_name']}</p></td>
                    <td><p>{$vo['create_time']|date='Y-m-d H:i:s',###}</p></td>
                    <td><p>￥{$vo['price']}</p></td>
                    <td>
                        <a class="btn selecta" data-img-id="{$vo['img_id']}" data-money="{$vo['price']}" data-img_path="{$vo['img_cover']}" data-short_title="{$vo['introduction']}" data-goods-id="{$vo['goods_id']}" data-value="{$vo.goods_id}"  data-name="{$vo.goods_name}">选择</a>
                    </td>
                </tr>
            {/volist}
            </tbody>
        </table>
        <div class="n_page_no">
            {$page}
        </div>
    </ul>
    <div style="height:60px; line-height: 60px;"></div>
    <div class="sel_fun_opt" style="bottom: 20px;">
        <div class="sure" onclick="">确定</div>
        <div class="cancel" onclick="">返回</div>
    </div>
</div>
<script src="/public/js/jquery-2.1.1.js" type="text/javascript"></script>
<script type="text/javascript" src="/public/static/layer/2.4/layer.js"></script>
<script type="text/javascript">
    $(".selecta").click(function(){
        if ($(this).hasClass('selectedb')) {
        }else{
            $(this).addClass('selectedb');
            $(this).html('已选择');
            $(this).parent().parent().siblings().find('.selecta').removeClass('selectedb');
            $(this).parent().parent().siblings().find('.selecta').html('选择');
        }
    });
    $(".sure").click(function(){
        if (typeof($('.selectedb').attr('data-name'))=="undefined"){
                layer.msg('请选择内容',{icon:5,time:1000});
                return false;
        }
        var item = {};
        item['img_id'] = $('.selectedb').attr('data-img-id');
        item['goods_id'] = $('.selectedb').attr('data-goods-id');
        item['name'] = $('.selectedb').attr('data-name');
        item['img_path'] = $('.selectedb').attr('data-img_path');
        item['price'] = $('.selectedb').attr('data-money');
        parent.get_images(item);
       var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    })
    $(".cancel").click(function(){
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    });
</script>
</body>
</html>
